-------------------------------------------------------------------------------

--os.execute("cmd");
function ppp(f)
    DC():PrintDebug(DC():ToUtf8 (f))
    --print(f)
end

testString = [[ { "one":1 , "two":2, "primes":[2,3,5,7] } ]]

local http = require("socket.http")
local json = require("json")
local ltn12 = require("ltn12")

local t={}
local url1
for line in io.lines("c:/temp/.aibot.pid") do 
url1 = line
break
end
ppp("start")
response_body = {}   
request_body = testString

r, c, h = http.request {
  method = "POST",
  url = url1.."/q",
  headers = {   
            ["Content-Length"] = string.len(request_body),   
            ["Content-Type"] =  "text/plain;charset=windows-1251",
            ["Content-Language"] = "ru",
         },  
  source = ltn12.source.string(request_body),   
  sink = ltn12.sink.table(response_body)
}

ppp(r)
ppp(c)
o = json.decode(response_body[1])
for i,v in pairs(o) do
    if v and type(v)=="table" then 
 	
    else
     ppp(i.." "..v)
    end



  end
